<div :class="{ 'grid': true, 'show-paging-bar': isEnablePagingBar, 'hidden-paging-bar': !isEnablePagingBar }">
    <i-form>
    <el-table v-if="isDisplay === true"
        :default-sort="{ prop: minorSortPSDEF, order: Object.is(minorSortDir, 'ASC') ? 'ascending' : Object.is(minorSortDir, 'DESC') ? 'descending' : '' }"  
        @sort-change="onSortChange($event)"  
        :border="isDragendCol"
        :highlight-current-row ="isSingleSelect"
        :row-class-name="getRowClassName.bind(_self)"
        :cell-class-name="getCellClassName.bind(_self)"
        size="mini"
        stripe
        @row-click="rowClick($event)"  
        @select-all="selectAll($event)"  
        @select="select($event)"  
        @row-class-name="onRowClassName($event)"  
        @row-dblclick="rowDBLClick($event)"  
        ref='multipleTable' :data="items" :show-header="!isHideHeader">
            <template slot="empty">
                无数据 
                <span class="quick-toolbar">
                </span>
            </template>
            <template v-if="!isSingleSelect">
                <el-table-column align="center" type='selection' :width="checkboxColWidth"></el-table-column>
            </template>
            <template v-if="getColumnState('employeecode')">
                <el-table-column show-overflow-tooltip :prop="'employeecode'" :label="$t('entities.hrcontract.active_grid.columns.employeecode')" :width="120"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.hrcontract.active_grid.columns.employeecode')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.employeecode}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('hremployeename')">
                <el-table-column show-overflow-tooltip :prop="'hremployeename'" :label="$t('entities.hrcontract.active_grid.columns.hremployeename')" :width="120"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.hrcontract.active_grid.columns.hremployeename')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.hremployeename}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('organizationname')">
                <el-table-column show-overflow-tooltip :prop="'organizationname'" :label="$t('entities.hrcontract.active_grid.columns.organizationname')" :width="200"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.hrcontract.active_grid.columns.organizationname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.organizationname}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('empstate')">
                <el-table-column show-overflow-tooltip :prop="'empstate'" :label="$t('entities.hrcontract.active_grid.columns.empstate')" :width="120"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.hrcontract.active_grid.columns.empstate')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.empstate" tag='CL_HR_0016' codelistType='DYNAMIC' ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('contractcode')">
                <el-table-column show-overflow-tooltip :prop="'contractcode'" :label="$t('entities.hrcontract.active_grid.columns.contractcode')" :width="120"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.hrcontract.active_grid.columns.contractcode')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.contractcode}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('contractmode')">
                <el-table-column show-overflow-tooltip :prop="'contractmode'" :label="$t('entities.hrcontract.active_grid.columns.contractmode')" :width="150"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.hrcontract.active_grid.columns.contractmode')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.contractmode" tag='CL_HR_0021' codelistType='STATIC' ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('contracttype')">
                <el-table-column show-overflow-tooltip :prop="'contracttype'" :label="$t('entities.hrcontract.active_grid.columns.contracttype')" :width="150"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.hrcontract.active_grid.columns.contracttype')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.contracttype" tag='CL_HR_0022' codelistType='STATIC' ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('begintime')">
                <el-table-column show-overflow-tooltip :prop="'begintime'" :label="$t('entities.hrcontract.active_grid.columns.begintime')" :width="120"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.hrcontract.active_grid.columns.begintime')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-format-data format="YYYY-MM-DD" :data="row.begintime"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('endtime')">
                <el-table-column show-overflow-tooltip :prop="'endtime'" :label="$t('entities.hrcontract.active_grid.columns.endtime')" :width="120"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.hrcontract.active_grid.columns.endtime')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-format-data format="YYYY-MM-DD" :data="row.endtime"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('contractstate')">
                <el-table-column show-overflow-tooltip :prop="'contractstate'" :label="$t('entities.hrcontract.active_grid.columns.contractstate')" :width="120"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.hrcontract.active_grid.columns.contractstate')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.contractstate" tag='CL_HR_0019' codelistType='STATIC' ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('uagridcolumn1')">
                <el-table-column :column-key="'uagridcolumn1'" :label="$t('entities.hrcontract.active_grid.columns.uagridcolumn1')" :width="100"  :align="'center'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                          <i class='fa fa-pencil'></i>
                        {{$t('entities.hrcontract.active_grid.columns.uagridcolumn1')}}
                      </span>
                    </template>
                    <template slot-scope="scope">
                        <div style="text-align: center;">
                          <a v-show="scope.row.Stop.visabled" :disabled="scope.row.Stop.disabled" @click="uiAction(scope.row, 'Stop', $event)" :title="$t('entities.hrcontract.active_grid.uiactions.hrcontract_stop')">
                            <i class='fa fa-power-off'></i>
                            {{$t('entities.hrcontract.active_grid.uiactions.hrcontract_stop')}}
                          </a>
                        </div>
                    </template>
                </el-table-column>
            </template>
            <template v-if="adaptiveState">
                <el-table-column></el-table-column>
            </template>
    </el-table>
    <row class='grid-pagination' v-show="items.length > 0">
        <page class='pull-right' @on-change="pageOnChange($event)" 
            @on-page-size-change="onPageSizeChange($event)"
            :transfer="true" :total="totalRecord"
            show-sizer :current="curPage" :page-size="limit"
            :page-size-opts="[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]" show-elevator show-total>
            <span>
                <span class="page-column">
                    <poptip transfer placement="top-start">
                        <i-button icon="md-menu">{{$t('app.gridpage.choicecolumns')}}</i-button>
                        <div slot="content">
                            <template v-for="col in allColumns">
                                <div :key="col.name"><el-checkbox v-model="col.show" @change="onColChange()">{{$t(col.langtag)}}</el-checkbox></div>
                            </template>
                        </div>
                    </poptip>
                </span>
                <span v-if="selections.length > 0" class="batch-toolbar">
                </span>
                <span class="page-button"><i-button icon="md-refresh" :title="$t('app.gridpage.refresh')" @click="pageRefresh()"></i-button></span>&nbsp;
                <span>
                    {{$t('app.gridpage.show')}}&nbsp;
                    <span>
                        <template v-if="items.length === 1">
                        1
                        </template>
                        <template v-else>
                            <span>{{(curPage - 1) * limit + 1}}&nbsp;-&nbsp;{{totalRecord > curPage * limit ? curPage * limit : totalRecord}}</span>
                        </template>
                    </span>&nbsp;
                    {{$t('app.gridpage.records')}}，{{$t('app.gridpage.totle')}}&nbsp;{{totalRecord}}&nbsp;{{$t('app.gridpage.records')}}
                </span>
            </span>
        </page>
    </row>
  </i-form>
</div>